package com.zq.digui;

/**
 * 求阶乘
 */
public class Digui {
    public static void main(String[] args) {
//        System.out.println(diGui(4));
        System.out.println(diGui(1));

    }

   /* public static int diGui(int n){
        return n==1?1:diGui(n-1)*n;
    }*/

    /**
     *f(x+1)=f(x)-f(x)/2-1
     * 2f(x+1)=f(x)-2
     * f(x)=2f(x+1)+2
     */
   public static int diGui(int n){
       return n==10?1:2*diGui(n+1)+2;
   }
}
